package ca.ualberta.cs.DB2ExceptionHandling;

import java.sql.SQLException;

public class DB2SqlException{// extends SQLException{
	
	public static void printSqlErrorMsg(SQLException e){
		System.err.println("SQLException:");
		while(e!=null) {
			System.err.println ("Error msg: " + e.getMessage());
			System.err.println ("SQLSTATE: " + e.getSQLState());
			System.err.println ("Error code: " + e.getErrorCode());
			e.printStackTrace();				
			//if(e.getErrorCode() == -4470 )					
			//FIXME I think I should restart db2 driver?				
			e = e.getNextException();
		}
	}

}
